import 'package:dio/dio.dart';

class RespData<T> {
  T? data;

  // http code, 200 404 500 and so on..
  int? statusCode;

  // business code
  int? code;

  // msg
  String? message;

  // error type
  DioErrorType? dioErrorType;

  RespData({this.data, this.statusCode, this.code, this.message, this.dioErrorType});

  // bool get isSuccess {
  //   return 0 == code;
  // }

  @override
  String toString() {
    return 'Response{data: $data, statusCode: $statusCode, code: $code, message: $message, dioErrorType: $dioErrorType}';
  }
}
